﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Barry.Model
{
    public class News
    {
        public virtual int ID { protected set; get; }

        public virtual DateTime Date { set; get; }

        public virtual string Title { set; get; }

        public virtual string Body { set; get; }

        public virtual bool IsPublish { set; get; }

        // public virtual bool Test { set; get; }
    }

    public class NewsMap : ClassMap<News>
    {
        public NewsMap()
        {
            Id(x => x.ID);
            Map(x => x.Title).Length(200).Not.Nullable();
            Map(x => x.Date).Not.Nullable();
            Map(x => x.Body).CustomType("StringClob").CustomSqlType("nvarchar(max)");
            Map(x => x.IsPublish).Not.Nullable();
            //  Map(x => x.Test);
        }
    }
}
